﻿using Microsoft.Xna.Framework.Input;

namespace Firefly.Framework.Windows
{
    public class KeyToStringConverter
    {
        public static string Convert(Keys key, bool shiftDown)
        {
            switch (key)
            {
                case Keys.A:
                    if (shiftDown)
                    {
                        return "A";
                    }
                    else
                    {
                        return "a";
                    }
                case Keys.B:
                    if (shiftDown)
                    {
                        return "B";
                    }
                    else
                    {
                        return "b";
                    }
                case Keys.C:
                    if (shiftDown)
                    {
                        return "C";
                    }
                    else
                    {
                        return "c";
                    }
                case Keys.D:
                    if (shiftDown)
                    {
                        return "D";
                    }
                    else
                    {
                        return "d";
                    }
                case Keys.E:
                    if (shiftDown)
                    {
                        return "E";
                    }
                    else
                    {
                        return "e";
                    }
                case Keys.F:
                    if (shiftDown)
                    {
                        return "F";
                    }
                    else
                    {
                        return "f";
                    }
                case Keys.G:
                    if (shiftDown)
                    {
                        return "G";
                    }
                    else
                    {
                        return "g";
                    }
                case Keys.H:
                    if (shiftDown)
                    {
                        return "H";
                    }
                    else
                    {
                        return "h";
                    }
                case Keys.I:
                    if (shiftDown)
                    {
                        return "I";
                    }
                    else
                    {
                        return "i";
                    }
                case Keys.J:
                    if (shiftDown)
                    {
                        return "J";
                    }
                    else
                    {
                        return "j";
                    }
                case Keys.K:
                    if (shiftDown)
                    {
                        return "K";
                    }
                    else
                    {
                        return "k";
                    }
                case Keys.L:
                    if (shiftDown)
                    {
                        return "L";
                    }
                    else
                    {
                        return "l";
                    }
                case Keys.M:
                    if (shiftDown)
                    {
                        return "M";
                    }
                    else
                    {
                        return "m";
                    }
                case Keys.N:
                    if (shiftDown)
                    {
                        return "N";
                    }
                    else
                    {
                        return "n";
                    }
                case Keys.O:
                    if (shiftDown)
                    {
                        return "O";
                    }
                    else
                    {
                        return "o";
                    }
                case Keys.P:
                    if (shiftDown)
                    {
                        return "P";
                    }
                    else
                    {
                        return "p";
                    }
                case Keys.Q:
                    if (shiftDown)
                    {
                        return "Q";
                    }
                    else
                    {
                        return "q";
                    }
                case Keys.R:
                    if (shiftDown)
                    {
                        return "R";
                    }
                    else
                    {
                        return "r";
                    }
                case Keys.S:
                    if (shiftDown)
                    {
                        return "S";
                    }
                    else
                    {
                        return "s";
                    }
                case Keys.T:
                    if (shiftDown)
                    {
                        return "T";
                    }
                    else
                    {
                        return "t";
                    }
                case Keys.U:
                    if (shiftDown)
                    {
                        return "U";
                    }
                    else
                    {
                        return "u";
                    }
                case Keys.V:
                    if (shiftDown)
                    {
                        return "V";
                    }
                    else
                    {
                        return "v";
                    }
                case Keys.W:
                    if (shiftDown)
                    {
                        return "W";
                    }
                    else
                    {
                        return "w";
                    }
                case Keys.X:
                    if (shiftDown)
                    {
                        return "X";
                    }
                    else
                    {
                        return "x";
                    }
                case Keys.Y:
                    if (shiftDown)
                    {
                        return "Y";
                    }
                    else
                    {
                        return "y";
                    }
                case Keys.Z:
                    if (shiftDown)
                    {
                        return "Z";
                    }
                    else
                    {
                        return "z";
                    }
                case Keys.D0:
                    if (shiftDown)
                    {
                        return ")";
                    }
                    else
                    {
                        return "0";
                    }
                case Keys.D1:
                    if (shiftDown)
                    {
                        return "!";
                    }
                    else
                    {
                        return "1";
                    }
                case Keys.D2:
                    if (shiftDown)
                    {
                        return "@";
                    }
                    else
                    {
                        return "2";
                    }
                case Keys.D3:
                    if (shiftDown)
                    {
                        return "#";
                    }
                    else
                    {
                        return "3";
                    }
                case Keys.D4:
                    if (shiftDown)
                    {
                        return "$";
                    }
                    else
                    {
                        return "4";
                    }
                case Keys.D5:
                    if (shiftDown)
                    {
                        return "%";
                    }
                    else
                    {
                        return "5";
                    }
                case Keys.D6:
                    if (shiftDown)
                    {
                        return "^";
                    }
                    else
                    {
                        return "6";
                    }
                case Keys.D7:
                    if (shiftDown)
                    {
                        return "&";
                    }
                    else
                    {
                        return "7";
                    }
                case Keys.D8:
                    if (shiftDown)
                    {
                        return "*";
                    }
                    else
                    {
                        return "8";
                    }
                case Keys.D9:
                    if (shiftDown)
                    {
                        return "(";
                    }
                    else
                    {
                        return "9";
                    }
                case Keys.OemBackslash:
                    if (shiftDown)
                    {
                        return "|";
                    }
                    else
                    {
                        return "\\";
                    }
                case Keys.OemCloseBrackets:
                    if (shiftDown)
                    {
                        return "}";
                    }
                    else
                    {
                        return "]";
                    }
                case Keys.OemComma:
                    if (shiftDown)
                    {
                        return "<";
                    }
                    else
                    {
                        return ",";
                    }
                case Keys.OemOpenBrackets:
                    if (shiftDown)
                    {
                        return "{";
                    }
                    else
                    {
                        return "[";
                    }
                case Keys.OemPeriod:
                    if (shiftDown)
                    {
                        return ">";
                    }
                    else
                    {
                        return ".";
                    }     
                case Keys.OemQuestion:
                    if (shiftDown)
                    {
                        return "?";
                    }
                    else
                    {
                        return "/";
                    }
                case Keys.OemPipe:
                    if (shiftDown)
                    {
                        return "|";
                    }
                    else
                    {
                        return "\\";
                    }
                case Keys.OemSemicolon:
                    if (shiftDown)
                    {
                        return ":";
                    }
                    else
                    {
                        return ";";
                    }
                case Keys.OemMinus:
                    if (shiftDown)
                    {
                        return "_";
                    }
                    else
                    {
                        return "-";
                    }
                case Keys.OemPlus:
                    if (shiftDown)
                    {
                        return "+";
                    }
                    else
                    {
                        return "=";
                    }
                case Keys.OemQuotes:
                    if (shiftDown)
                    {
                        return "\"";
                    }
                    else
                    {
                        return "'";
                    }
                case Keys.OemTilde:
                    if (shiftDown)
                    {
                        return "~";
                    }
                    else
                    {
                        return "`";
                    }
                default:
                    return string.Empty;
            }
        }
    }
}
